<?php

 
 Zend_Loader::loadClass("BaseDBRows");
 Zend_Loader::loadClass("Country");
 class Countries extends BaseDBRows
 {
 	protected function setUp()
 	{
 		$this->_tableName = Country::_tablename;
 	}	
	
	public function getCountries($fields=array()){
		Zend_Loader::loadClass("QueryCreator");
		
		$query = new QueryCreator();
		if(count($fields)) {
			foreach($fields as $key => $value) {
				$query->addSelect($value);
			}
		} else {
			$query->addSelect(" * ");
		}
		$query->addFrom($this->_tableName );
		$query->addOrderBy(" country ");
		
		$db = DBCon::instance();
		
		$result = $db->executeQuery($query->createSQL());
		return $result;
		
	}
	
 }
?>